/**************************************************************************
 *
 * Copyright 2014 MaeckySoft Ltd., Bludenz, Austria.
 * All Rights Reserved.
 *
 **************************************************************************/

#ifndef MFONTTEXTURE_H
#define MFONTTEXTURE_H

#include <M3DBase.h>
#include <MFTManager.h>
#include <MGlyph.h>
#include <MPNG.h>
#include <map>

class MFontTexture : M3DBase
{
    public:
        MFontTexture(int iDebug);
        void setFont(std::string sFontName);
        std::string getFont();
        void setOutputFileName(std::string sFileName);
        std::string getOutputFileName();
		void printMethodInfo(std::string method);
		int getFontSize();
		void setFontSize(int iFontSize);
		std::string getRenderCharSet();
		void setRenderCharSet(std::string s_CharSet);
        MGlyph* getGlyphFromChar(char cCharacter);
        std::map<char, MGlyph*> *getGlyphMap();
		long setXYPos(int x, int y, int linewidth);
		int getMaxGlyphHeight();
		int getMaxGlyphWidth();
		int calculateImageHeight();
		int calculateImageWidth();
        int renderCharSet();
		int packCharSet();
        ~MFontTexture();
    protected:
    private:
        std::string m_sOutputFile;
        std::string m_sFontName;
        std::string m_sCharSet;
        MFTManager *m_MFTMMainFontManager;
        int m_iFontSize;
        std::map<char, MGlyph*> m_mapGlyphs;
};

#endif // MFONTTEXTURE_H
